package com.zsinfo.guoss.supplier.fragment.PaySetting;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.zsinfo.guoss.supplier.R;
import com.zsinfo.guoss.supplier.activity.PaySettingsActivity;

import java.util.HashMap;
import java.util.Map;

/**
 * A simple {@link Fragment} subclass.
 */
public class Fragment_pay_settings extends Fragment {


    private PaySettingsActivity paySettingsActivity;

    private TextView setting_text;

    private int redictTo = 0;

    public Fragment_pay_settings() {

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_fragment_pay_settings, container, false);

        paySettingsActivity = (PaySettingsActivity) getActivity();
        setting_text = (TextView) view.findViewById(R.id.setting_text);

        wallet_whether_new();

        view.findViewById(R.id.home_main).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (redictTo == 0) {
                    paySettingsActivity.switchFragment("Fragment_Validate");
                } else {
                    paySettingsActivity.setFlag = 0;
                    paySettingsActivity.switchFragment( "Fragment_PwdSettings");
                }
            }
        });
        return view;
    }

    private void wallet_whether_new() {

        Map<String, String> map = new HashMap<String, String>();
//        map.put("method", "wallet_whether_new");
//        map.put("firmId", SharedPreferencesUtil.getfirmId());

//        NetMessageUtil.RequestForPost(UrlUtils.SERVE, map, new NetMessageUtil.PostCallBack() {
//
//            @Override
//            public void send(String s) {
//
//                org.json.JSONObject statusStr = JsonUtil.getJsonPara(s);
//
//                String status = JsonUtil.getSinglePara(statusStr, "status");
//
//                if (status.equals("0")) {
//                    setting_text.setText("设置");
//                    redictTo = 0;
//                } else {
//                    setting_text.setText("修改");
//                    redictTo = 1;
//                }
//            }
//
//            @Override
//            public void error(String s) {
//
//            }
//        });
    }


}
